@extends('admin.base')

@section('content')
    <div class="layui-card" style="margin-top: 20px; height: 580px;">
        <div class="layui-card-body">
            <div class="layui-form">
                {{csrf_field()}}
                {{method_field('put')}}
                <input type="hidden" name="id" value="{{$data['id']}}">
                <div class="layui-form-item">
                    <label class="layui-form-label">网站：</label>
                    <div class="layui-input-inline layui-width-300">
                        <select name="websiteId" id="websiteId">
                            @foreach($websiteData as $val)
                                <option value="{{$val['id']}}"  @if($data['website_id'] == $val['id']) selected @endif  >{{$val['names']}}</option>
                            @endforeach
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label for="" class="layui-form-label">图片标题</label>
                    <div class="layui-input-inline">
                        <input type="text" name="titles" value="{{$data['titles']}}"  placeholder="" class="layui-input layui-width-300">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label for="" class="layui-form-label">描述</label>
                    <div class="layui-input-inline">
                        <textarea placeholder="请输入内容" class="layui-textarea layui-width-300" name="describes">{{$data['describes']}}</textarea>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label for="" class="layui-form-label">跳转地址</label>
                    <div class="layui-input-inline">
                        <input type="text" name="jump_url" value="{{$data['jump_url']}}"  placeholder="" class="layui-input layui-width-300">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label for="" class="layui-form-label">排序值</label>
                    <div class="layui-input-inline">
                        <input type="text" name="sort" value="{{$data['sort']}}"  placeholder="排序值，越小越靠前" class="layui-input layui-width-300">
                    </div>
                </div>


                <input type="hidden" value="15" id="tong">
                <div class="layui-form-item"  style="width:80%">
                    <label class="layui-form-label required">图片</label>
                    <div class="layui-input-block">
                        <div class="layui-upload">
                            <button type="button" class="layui-btn layui-btn-sm" id="uploadPic">上传</button>
                            <div class="layui-upload-list">
                                <ul id="layui-upload-box" class="layui-clear">
                                    <img style="width: 150px;" src="{{$data['thumbs']}}">
                                </ul>
                                <input type="hidden" name="thumbs" id="thumb"  value="{{$data['thumbs']}}" lay-verify="required" />
                            </div>
                        </div>
                    </div>
                </div>

                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button type="submit" class="layui-btn layui-btn-sm" lay-submit="" lay-filter="formSubmitData" wy-data="{url:'{{route('admin.banners.update')}}'}" ><i class="fa fa-save"></i> 保存</button>
                        <a href="javascript:parent.layui.layer.closeAll();" class="layui-btn layui-btn-primary layui-btn-sm"><i class="fa fa-reply-all" aria-hidden="true"></i>  取消</a>
                    </div>
                </div>

            </div>
        </div>
    </div>
@endsection

@section('script')
    @include('admin.common._js_upload')
@endsection
